// 根据数据库自动生成 model
const Automate = require('sequelize-automate');
const config = require('../config');
// dbOptions 和 options 
const dbOptions = {
	"database": config.database,
	"username": config.username,
	"password": config.password,
	"dialect": "mysql",
	"host": config.host,
	"port": config.port,
	"logging": false
};
const options = {
	"type": "js",
	"dir": "models"
}

// 创建一个 automate 实例
const automate = new Automate(dbOptions, options);

(async function main() {
	// // 获取 Models JSON 定义
	// const definitions = await automate.getDefinitions();
	// console.log(definitions);

	// 或生成代码
	const code = await automate.run();
	//   console.log(code);
})()
